Skip to content

Conversation

@mprib
Copy link
Owner

@mprib mprib commented Jan 15, 2026

Summary

  • Add toggleable overlay layers for intrinsic calibration visualization
  • Fix scrubbing failure near end of video
  • Rename streaming components for clarity

Changes

Point History Visualization

  • Current frame points (red) - from FramePacket.points
  • Accumulated points (teal, 50% opacity) - all detected points
  • Selected board grids (cyan) - frames used in calibration

Scrubbing Bug Fix

Root cause: PTS-to-frame-index calculation used int() which truncated incorrectly due to floating point precision. Fixed with round().

Naming Cleanup

Before After
FramePacketPublisher FramePacketStreamer
jump_to() seek_to()
exact param precise param
break_on_last end_behavior: Literal["stop", "pause"]
get_frame_fast() get_nearest_keyframe()
FrameProcessingThread FrameRenderThread

Test plan

  • All 128 tests pass
  • Manual verification of scrubbing through entire video
  • Overlay toggles work in intrinsic calibration view

Closes #869

mprib added 3 commits January 15, 2026 07:06
Add toggleable overlay layers to intrinsic calibration view:
- Current frame points (red circles)
- Accumulated points (teal, semi-transparent)
- Selected calibration grids (cyan lines showing coverage)

Presenter exposes thread-safe access to collected points and selection
result. View owns all rendering with sizes scaled to image dimensions.
Cached frame re-rendering avoids jumping to frame 0 on toggle.

Refs #869
Root cause: PTS-to-frame-index calculation used int() which truncated
incorrectly due to floating point precision (557.8125 -> 557 instead of 558).

Changes:
- Use round() instead of int() for PTS calculations in FrameSource
- Add keyframe indexing at init to find actual last accessible frame
- Handle seek failure gracefully (set skip_read=True to prevent death)
- Use condition variable instead of polling for responsive pause loop
- Implement min(timestamps, source) for last_frame_index safety
- Fix button text bug by reordering state clearing in Presenter
- Update test_last_frame_index to verify accessibility not metadata

Refs #869
Naming cleanup from senior dev review:
- FramePacketPublisher → FramePacketStreamer
- create_publisher() → create_streamer()
- jump_to() → seek_to()
- exact parameter → precise parameter
- break_on_last → end_behavior: Literal["stop", "pause"]
- get_frame_fast() → get_nearest_keyframe()
- FrameProcessingThread → FrameRenderThread

These names better reflect the components' roles:
- "Streamer" emphasizes video streaming over pub/sub
- "seek_to" aligns with video player terminology
- "precise" is clearer than "exact" for frame accuracy
- "end_behavior" as Literal is self-documenting
- "get_nearest_keyframe" describes what it actually returns
- "FrameRenderThread" clarifies it renders, not processes

Refs #869
@mprib mprib merged commit 8838f91 into 885-epic-video-playback-refactor Jan 15, 2026
9 checks passed
@mprib mprib deleted the 869-add-point-history-visualization-to-intrinsiccalibrationpresenter branch January 15, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants